#include "dkglMain.h"
#include "dkglKernel.h"
#include <IL/il.h>


namespace DKGL
{

	DKGLMain::DKGLMain()
	try
		:_pImpl(new DKGLMainImpl())
	{
		// force Kernel's constructor running
		Kernel::instance().init();
		init3rdPartyLibs();
	}
	catch(...)
	{
		throw;
	}

	DKGLMain::~DKGLMain()
	{
		release3rdPartyLibs();
	}

	void DKGLMain::go()
	{
		_pImpl->go();
	}

	void DKGLMain::init3rdPartyLibs()
	{
		// DevIL
		ilInit();
	}

	void DKGLMain::release3rdPartyLibs()
	{
		
	}

	void DKGLMain::registerKeyboardHandler(OIS::KeyListener* key)
	{
		_pImpl->registerKeyboardHandler(key);
		//
	}
		
	void DKGLMain::registerMouseHandler(OIS::MouseListener* mouse)
	{
		_pImpl->registerMouseHandler(mouse);
	
	}
}
